Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate hexo-recommended-posts plugin #2054

Closed
wants to merge 2 commits into from
Closed

Integrate hexo-recommended-posts plugin #2054

wants to merge 2 commits into from

Conversation

huiwang
Copy link
Contributor

@huiwang huiwang commented Dec 26, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the new behavior?

Recommended posts to promote your blog with both internal and external links
More details about the plugin here

How to use?

Install and configure the plugin hexo-recommended-posts first.

Then In NexT _config.yml:

# Recommended posts
# Dependency: https://github.com/huiwang/hexo-recommended-posts
recommended_posts:
  enabled: true

Does this PR introduce a breaking change?

  • Yes.
  • No.

@huiwang
Copy link
Contributor Author

huiwang commented Dec 27, 2017

Hello All, I noticed the guidelines (as mentioned in the PR) on commit messages are not clear. Shall we improve it?

@ivan-nginx
Copy link
Collaborator

@huiwang take it easy. Need some time. And i see what all look's fine. Just need to wait, ok?

@huiwang
Copy link
Contributor Author

huiwang commented Dec 27, 2017

@ivan-nginx thx for help 👍 . no problem. I mean if we need to improve the guidelines, I can contribute :)

@ivan-nginx
Copy link
Collaborator

@huiwang yes, we need. We need a lot of work to improve NexT. Any contributes are welcome, thank's!

@huiwang
Copy link
Contributor Author

huiwang commented Dec 27, 2017

@ivan-nginx by the way, I appreciate a lot that you added my blog as a live preview. Thanks very much!

@ivan-nginx
Copy link
Collaborator

No problem, take it easy. NexT will the best template engine in Hexo. Just need a little time.

@ivan-nginx
Copy link
Collaborator

@huiwang hi again.

I detailed see your plugin and have some questions:

  1. Can u please explain for external server work, why in config only static «https://api.truelaurel.com» link? truelaurel.com — your site, right? Any backlogs there?
  2. Why there are no instruction to set up own encore server. Please, add some instructoions there. No need to repeat error with Gitment. First of all, user must have choice to use or not to use any external servers with send any data from/to it.
  3. Config in NexT must have all possible options, but there is 1 option only.

@huiwang
Copy link
Contributor Author

huiwang commented Dec 28, 2017

Hi @ivan-nginx, thx for reviewing the PR in details.

Here is what happens when a user types hexo recommend (source code)

  • hexo uploads post information(link, title,tags) to the recommendation server
  • recommendation server computes recommendation list upon each new post upload (source code)
  • hexo dowloads recommeded post from the server

In order to increase visibility and to build trust, everything is open sourced: from backend server to frontend plugin. A user can setup his/her own recommendation server. In the plugin we give the freedom to choose any server.

Then let me answer your questions.

Can u please explain for external server work, why in config only static «https://api.truelaurel.com» link? truelaurel.com — your site, right? Any backlogs there?

The external server build links between posts through tag matching. truelaurel.com (my site) is one open-sourced implementation of such a recommendation server. Anyone can build his/her own server and can choose to open source it or not.

Why there are no instruction to set up own encore server. Please, add some instructoions there. No need to repeat error with Gitment. First of all, user must have choice to use or not to use any external servers with send any data from/to it.

You are absolutely right. I need to add some documentation to the server in addition to open sourced codes. The plugin has an offline mode(source code) when the server is not avaialbe but only internal links are included in the recommendation list in this mode.

Do you think it's better to let user choose online and offline mode? please note that the real added value of this plugin is to build inter-blog links. we already have many choices on offline related posts plugin.

Config in NexT must have all possible options, but there is 1 option only.
Could you please speicify other options, online/offline?

Thanks!

@huiwang
Copy link
Contributor Author

huiwang commented Dec 28, 2017

@ivan-nginx I added some docs on the recommendation server. What do you think of it?

@ivan-nginx
Copy link
Collaborator

@huiwang seems good for basic readme, but:

Why there are no instruction to set up own encore server.

For example, this is full installation instrutions of NexT.

@huiwang
Copy link
Contributor Author

huiwang commented Dec 29, 2017

@ivan-nginx now I get your point. In fact, encore server is a rest server based on java spring boot and it uses mongodb to save posts. The entire stack is dockerized which allows to deploy the server in the cloud. I'll add some notes on this part.

Thanks for pointing that out! Are there anything else that I was not clear?

@ivan-nginx
Copy link
Collaborator

ivan-nginx commented Dec 29, 2017

Yep, all fine. All of we need i write before.

In fact, encore server is a rest server based on java spring boot and it uses mongodb to save posts.

I totally understand it and i want to test it, to see what and where write, how about speed, etc. Are u sure what your server will not overloaded if something like ~5k peoples in 1 second will send to your server packets?

@huiwang
Copy link
Contributor Author

huiwang commented Dec 29, 2017

@ivan-nginx here is the detailed instruction on how to deploy the server. Please tell me if it works for you.

I totally understand it and i want to test it, to see what and where write, how about speed, etc. Are u sure what your server will not overloaded if something like ~5k peoples in 1 second will send to your server packets?

You are definitely right to be skeptical about performance. Here are some design decisions taken for performance concern

  • a new command hexo recommend is included in the plugin to avoid calling the server all the time. the blogger controls when to call the server. Normally, the blogger calls the server when he/she writes a new post.
  • the server only loads data once from database and then it run its matching algorithm only with in-memory data.
  • we have timeouts configured in the plugin to be able to switch to offline recommend algorithm if the server is not reachable.

It would be a great success for this plugin if we could have 5k requests/s. I think we could provide really great recommendation service then.

But all that said, I still don't have stress test and I'm not able to ensure that the server can handle the mentioned load without degradation.

@ivan-nginx
Copy link
Collaborator

ivan-nginx commented Dec 30, 2017

I see. Yeap. Need some time, holidays, etc. Your idea is very interesting, but for now i not totally understand how it works. Of course i can merge it, but, repeat: may be confuse with load balancing. It's not your fault or server, not. It's just when project growing up — peoples set up at least default settings and if all work fine, they resume to use it and forgot about advanced settings. I talk about it because i see it many times, for many different examples. So, a'm and talking about that: user must know, what there are many other options to tuning external or him's own server to get the best practice.

About ~5k peoples — of course there is not be able same traffic for now, but after the merge.. Who knows? I know many peoples who just update their NexT and not read news or latest releases or any addition documentations. They just see new options and turn it on, for example. Repeat: it's not they fault or anybody else; that's the word, Github, and need to be a little stronger with this.
And, yep, i think u maybe see what in my name the word «Nginx» is not the randomly word. Of course i know how to work connections and i try to make smoothest variant for all possible issues.

BTW, after NY a think i not will support this repo anymore, because i created group with NexT and planned to loading there all latest features and resume growing up. If u ask me why — u can read this.

P.S. Happy NY, dude!

@huiwang
Copy link
Contributor Author

huiwang commented Dec 30, 2017

@ivan-nginx thx for coming back. Forget about this PR and celebrate the new year. I'd like to have a deeper talk with you after the new year, not only on this idea but also more broadly about open source, life.

I wish you and your family a happy new year.See you in 2018! Thanks again!

@huiwang
Copy link
Contributor Author

huiwang commented Jan 3, 2018

@ivan-nginx as talked, I don't have performance test yet on the backend and we think it could be risky to integrate the plugin now. I suggest closing this PR at this stage.

For those who want to try this plugin at a personal scale, there is a solution to use the plugin without theme support.

Thanks for the interesting discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants